"""自定义异常体系"""


class CloudStorageError(Exception):
    """云存储基础异常类"""
    def __init__(self, message: str, error_code: str = None):
        super().__init__(message)
        self.message = message
        self.error_code = error_code
    
    def __str__(self):
        if self.error_code:
            return f"[{self.error_code}] {self.message}"
        return self.message


class AuthException(CloudStorageError):
    """认证相关异常"""
    pass


class FileNotFound(CloudStorageError):
    """文件未找到异常"""
    pass


class NetworkError(CloudStorageError):
    """网络相关异常"""
    pass